3.334 \(\int \cot ^2(e+f x) (a+b \sec ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=36 \[ a^2 (-x)-\frac{(a+b)^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f} \]

[Out]

-(a^2*x) - ((a + b)^2*Cot[e + f*x])/f + (b^2*Tan[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0803038, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {4141, 1802, 203} \[ a^2 (-x)-\frac{(a+b)^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^2*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-(a^2*x) - ((a + b)^2*Cot[e + f*x])/f + (b^2*Tan[e + f*x])/f

Rule 4141

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[((d*ff*x)^m*(a + b*(1 + ff^2*x^2)^(n/2))^p)/(1 + ff^
2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] && IntegerQ[n/2] && (IntegerQ[m/2] ||
EqQ[n, 2])

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cot ^2(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b \left (1+x^2\right )\right )^2}{x^2 \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (b^2+\frac{(a+b)^2}{x^2}-\frac{a^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{(a+b)^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f}-\frac{a^2 \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-a^2 x-\frac{(a+b)^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f}\\ \end{align*}

Mathematica [B]  time = 0.69248, size = 82, normalized size = 2.28 \[ -\frac{4 \sec (e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (a^2 f x \cos (e+f x)-\sin (f x) \left ((a+b)^2 \csc (e) \cot (e+f x)+b^2 \sec (e)\right )\right )}{f (a \cos (2 (e+f x))+a+2 b)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^2*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

(-4*(b + a*Cos[e + f*x]^2)^2*Sec[e + f*x]*(a^2*f*x*Cos[e + f*x] - ((a + b)^2*Cot[e + f*x]*Csc[e] + b^2*Sec[e])
*Sin[f*x]))/(f*(a + 2*b + a*Cos[2*(e + f*x)])^2)

________________________________________________________________________________________

Maple [A]  time = 0.049, size = 66, normalized size = 1.8 \begin{align*}{\frac{1}{f} \left ({a}^{2} \left ( -\cot \left ( fx+e \right ) -fx-e \right ) -2\,ab\cot \left ( fx+e \right ) +{b}^{2} \left ({\frac{1}{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }}-2\,\cot \left ( fx+e \right ) \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^2*(a+b*sec(f*x+e)^2)^2,x)

[Out]

1/f*(a^2*(-cot(f*x+e)-f*x-e)-2*a*b*cot(f*x+e)+b^2*(1/sin(f*x+e)/cos(f*x+e)-2*cot(f*x+e)))

________________________________________________________________________________________

Maxima [A]  time = 1.47566, size = 62, normalized size = 1.72 \begin{align*} -\frac{{\left (f x + e\right )} a^{2} - b^{2} \tan \left (f x + e\right ) + \frac{a^{2} + 2 \, a b + b^{2}}{\tan \left (f x + e\right )}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-((f*x + e)*a^2 - b^2*tan(f*x + e) + (a^2 + 2*a*b + b^2)/tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 0.488268, size = 153, normalized size = 4.25 \begin{align*} -\frac{a^{2} f x \cos \left (f x + e\right ) \sin \left (f x + e\right ) +{\left (a^{2} + 2 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - b^{2}}{f \cos \left (f x + e\right ) \sin \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-(a^2*f*x*cos(f*x + e)*sin(f*x + e) + (a^2 + 2*a*b + 2*b^2)*cos(f*x + e)^2 - b^2)/(f*cos(f*x + e)*sin(f*x + e)
)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \cot ^{2}{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**2*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Integral((a + b*sec(e + f*x)**2)**2*cot(e + f*x)**2, x)

________________________________________________________________________________________

Giac [A]  time = 1.29031, size = 66, normalized size = 1.83 \begin{align*} -\frac{{\left (f x + e\right )} a^{2} - b^{2} \tan \left (f x + e\right ) + \frac{a^{2} + 2 \, a b + b^{2}}{\tan \left (f x + e\right )}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-((f*x + e)*a^2 - b^2*tan(f*x + e) + (a^2 + 2*a*b + b^2)/tan(f*x + e))/f